package com.guoxin.chapter2.setnewstringtowlock;

/**
 * @author guoxin
 * @date 2019年8月20日
 */
public class Run {
	public static void main(String[] args) throws InterruptedException {
		Service service = new Service();

		Thread a = new Thread(new Runnable() {
			@Override
			public void run() {
				service.testMethod();
			}
		}, "A");

		Thread b = new Thread(new Runnable() {
			public void run() {
				service.testMethod();
			}
		}, "B");

		a.start();
		Thread.sleep(300);
		b.start();
	}
}
